package com.imau.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
@TableName("t_department")
public class Department implements Serializable {

    /**
     * 部门ID 主键
     */
    @TableId(type= IdType.ASSIGN_ID)
    private String did;

    /**
     * 部门名称
     */
    @NotBlank(message = "部门名称不能为空")
    @Size(min = 0, max = 30, message = "部门名称长度不能超过30个字符")
    private String deptName;

    /**
     * 部门说明
     */
    private String deptRemark;

    /**
     * 父部门ID
     */
    private String parentId;

    /**
     * 部门编码
     */
    private Integer orderNum;

    /**
     * 部门类别
     */
    private String category;
    /**
     * 部门状态:0正常,1停用
     */
    private String status;
    /**
     * 部门创建时间
     */
    private Date createTime;

    /**所有教师*/
    @TableField(exist=false)
    private List<Teacher> teachers;

    /**所有用户*/
    @TableField(exist=false)
    private List<User> users;
}
